package com.serviceprovider.business.module.admin.bonus.model;

//~--- JDK imports ------------------------------------------------------------

import java.util.Date;

public class BonusPayment {
    public static final Integer CASH     = new Integer(1);
    public static final Integer DISCOUNT = new Integer(2);
    private Double              amount;
    private Integer             bonusId;
    private Integer             id;
    private Integer             payAs;
    private Date                payDate;
    private Integer             userId;

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof BonusPayment)) {
            return false;
        }

        BonusPayment b  = (BonusPayment) obj;
        boolean      eq = ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));

        if (!eq) {
            return false;
        }

        eq = ((bonusId == null) && (b.bonusId == null)) || ((bonusId != null) && bonusId.equals(b.bonusId));

        if (!eq) {
            return false;
        }

        eq = ((userId == null) && (b.userId == null)) || ((userId != null) && userId.equals(b.userId));

        if (!eq) {
            return false;
        }

        eq = ((amount == null) && (b.amount == null)) || ((amount != null) && amount.equals(b.amount));

        if (!eq) {
            return false;
        }

        eq = ((payAs == null) && (b.payAs == null)) || ((payAs != null) && payAs.equals(b.payAs));

        if (!eq) {
            return false;
        }

        eq = ((payDate == null) && (b.payDate == null)) || ((payDate != null) && payDate.equals(b.payDate));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int prime  = 31;
        int result = 1;

        result = prime * result + ((id == null)
                                   ? 0
                                   : id.hashCode());
        result = prime * result + ((bonusId == null)
                                   ? 0
                                   : bonusId.hashCode());
        result = prime * result + ((userId == null)
                                   ? 0
                                   : userId.hashCode());
        result = prime * result + ((amount == null)
                                   ? 0
                                   : amount.hashCode());
        result = prime * result + ((payAs == null)
                                   ? 0
                                   : payAs.hashCode());
        result = prime * result + ((payDate == null)
                                   ? 0
                                   : payDate.hashCode());

        return result;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBonusId() {
        return bonusId;
    }

    public void setBonusId(Integer bonusId) {
        this.bonusId = bonusId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Integer getPayAs() {
        return payAs;
    }

    public void setPayAs(Integer payAs) {
        this.payAs = payAs;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }
}



